<template>
  <a-sub-menu key="sub4">
    <template #title>
      公告处理
      <down-outlined
        :style="{ fontSize: '14px', color: '#08c', padding: '5px' }"
      />
    </template>
    <a-menu-item key="11" @click="announceNotice">发布公告</a-menu-item>
    <a-menu-item key="12" @click="deleteNotice">删除公告</a-menu-item>
  </a-sub-menu>
  <a-sub-menu key="sub5">
    <template #title>
      事件管理
      <down-outlined
        :style="{ fontSize: '14px', color: '#08c', padding: '5px' }"
      />
    </template>
    <a-menu-item key="13" @click="audit">审核事件</a-menu-item>
    <a-menu-item key="14" @click="addEvent">添加事件</a-menu-item>
    <a-menu-item key="15" @click="queryEvent">查询事件</a-menu-item>
    <a-menu-item key="16" @click="updateEvent">更新事件</a-menu-item>
  </a-sub-menu>

  <a-sub-menu key="sub6">
    <template #title>
      视频监控
      <down-outlined
        :style="{ fontSize: '14px', color: '#08c', padding: '5px' }"
      />
    </template>
    <a-menu-item key="17" @click="openMonitor">开启监控</a-menu-item>
    <a-menu-item key="18" @click="closeMonitor">关闭监控</a-menu-item>
  </a-sub-menu>
</template>

<script setup>
import mitt from '@/mitt'
import { DownOutlined } from '@ant-design/icons-vue'
//将公告处理事件全局化
const announceNotice = () => {
  mitt.emit('announceNotice')
}
const audit = () => {
  mitt.emit('audit')
}
const deleteNotice = () => {
  mitt.emit('showModal', '2')
}
const openMonitor = () => {
  mitt.emit('openMonitor')
}
const closeMonitor = () => {
  mitt.emit('closeMonitor')
}
const addEvent = () => {
  mitt.emit('addEvent')
}
//查询事件全局化 updateEvent
const queryEvent = () => {
  mitt.emit('QueryEvent')
}
//更新事件全局化 updateEvent
const updateEvent = () => {
  mitt.emit('updateEvent')
}
</script>

<style></style>
